<?php

class Application_Form_UsuarioGranja extends Zend_Form
{
    protected $_id_granja;

    public function __construct($id_granja)
    {
        $this->_id_granja = $id_granja;
        parent::__construct();
    }

    public function init()
    {
        $this->setMethod('post');
        //id de la granja
        $this->addElement('hidden', 'id_granja', array('value' => $this->_id_granja));

        $this->addElement('text', 'correo', array(
            'label' => 'Correo:',
            'required' => true,
            'validators' => array(
                array('validator' => 'StringLength', 'options' => array(5, 45))
            )
        ));
        // Add the submit button
        $this->addElement('submit', 'submit', array(
            'ignore' => true,
            'label' => 'Invitar a usuario',
        ));

    }

    public function setIdGranja($id_granja)
    {
        $this->_id_granja = $id_granja;
    }

}

